package com.etc.controller;

import com.etc.entity.Books;
import com.etc.service.BooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/books")
@CrossOrigin
public class BooksController {
    @Autowired
    BooksService service;

    @RequestMapping("/get")
    public List<Books> getBooks(@RequestParam String bName){
        List<Books> list = service.selectByPrimaryKey(bName);
        return list;
    }
}
